package com.demo.common.redis.constant;

/**
 * lua脚本
 *
 * @author DayDayUp
 * create on 2023-08-24
 **/
public interface RedisLuaConstant {
    /**
     * 实现 redis 的 get delete 原子性 的lua 脚本
     */
    String RELEASE_LOCK =
            " if redis.call('get', KEYS[1]) == ARGV[1] " +
            " then " +
            "  return redis.call('del', KEYS[1]) " +
            " else " +
            "  return 0 " +
            " end ";
}
